package com.common.method;

import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.json.JSONException;
import org.json.JSONObject;

import com.android.ocean.util.common.StringUtil;
import com.http.MD5Tool;
import com.modle.User;


public class ServerPath {
	public static JSONObject wrapperJson(JSONObject jo) throws JSONException {
//		long t = System.currentTimeMillis() / 1000
//				+ SpServerTimeUtil.gTimeDiff();
		long t = System.currentTimeMillis() / 1000;
		jo.put("t", t);
		jo.put("v", MD5Tool.md5(t + "CdItV.cN"));
		return jo;
	}
	public static Map<String, User> userDatas = new HashMap<String, User>();
	public static User getUser(String id){
		return userDatas.get(id);
	}
	
	private static final String GET_URL = "http://s-151209.abc188.com/api1/mobupdate.php";
	private static final String POST_URL = "http://s-151209.abc188.com/api1/mob.php?m=mobile&c=index&a=";
	
	public static final String AD_LIST_PATH="http://s-151209.abc188.com/api1/mob.php?m=mobile&c=index&a=lists";

	public static final String IP_PATH="http://ipecho.net/plain";
	public static final String CITY_PATH="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip=";
	public static final String CATID_PATH="http://s-151209.abc188.com/api1/mob.php?m=mobile&c=index&a=category2";
	public static final String GET_SERVER_TIME="http://s-151209.abc188.com/api1/mobupdate.php";
	
	public static String PYQ_PATH = "http://121.40.206.3/api/monents/get/";
	public static String SERVER= "http://121.40.206.3";//"http://app.iartist.net.cn";
	public static String IMG_PATH="http://app.iartist.net.cn";
//	public static String SERVER="http://i-artist.demo.wilead.com";
//	public static String IMG_PATH="http://i-artist.demo.wilead.com";
	//注册
	public static String REG_PATH=SERVER+"/api/user";
	//验证码
	public static String YZM_PATH=SERVER+"/api/user/verifycode";
	//注册协议
	public static String REG_PRO_PATH=SERVER+"/api/agreement/register";
	public static String LOGIN_PATH=SERVER+"/api/user/login";
	//用户信息
	public static String USERINFO_PATH=SERVER+"/api/user/";
	//用户充值
	public static String USER_RECHARGE_PATH=SERVER+"/api/user/recharge/";
	//修改用户信息
	public static String USERINFO_MODIFY_PATH=SERVER+"/api/user/info/update/";
	//用户列表
	public static String USERLIST_PATH=SERVER+"/api/user/list";

	//添加好友by艺人号
	public static String ADD_FRIEND_BYNUM_PATH=SERVER+"/api/user/addfriend/systemNum";
	//添加好友
	public static String ADD_FRIEND_PATH="http://121.40.206.3/api/user/friend/add";
	//删除好友
	public static String FRIEND_DEL_PATH=SERVER+"/api/user/friend/delete";
	
	//好友列表   
	public static String FRIENDS_LIST_PATH=SERVER+"/api/user/friend/";
	
	public static String REGISTER_PATH = SERVER+"/api/rsync_user/";
	//申请好友
	public static String FRIENDS_APPLY_LIST_PATH=SERVER+"/api/user/friend-request/";
	//处理加好友
	public static String FRIENDS_APPLY_HANDLE_PATH=SERVER+"/api/user/friend-request-handle/";
	//添加黑名单
	public static String BLACK_ADD_PATH=SERVER+"/api/blacklist/add";
	//删除黑名单
	public static String BLACK_DEL_PATH=SERVER+"/api/blacklist/delete";
	//黑名单列表
	public static String BLACK_LIST_PATH=SERVER+"/api/blacklist/";
	//未读消息列表
	public static String NO_READ_MSG_PATH=SERVER+"/api/chat/lastlist/";
	
	//用户搜索
	public static String USER_SEARCH_PATH="http://121.40.206.3/api/user/search";
	//获取简历
     public static String RESUME_GET_PATH=SERVER+"/api/user/resume/";
     //发布到朋友圈
     public static String PUBLISH_TO_PYQ=SERVER+"/api/monents/post/";
     
     //发布到朋友圈
     public static String REMOVE_TO_PYQ=SERVER+"/api/monents/remove";
   
     
 	//修改简历
     public static String RESUME_EDIT_PATH=SERVER+"/api/user/resume/edit/";
     //投递简历
     public static String RESUME_POST_PATH=SERVER+"/api/jobs/resumes/add/";
     //简历筛选
     public static String RESUME_FILTER_PATH=SERVER+"/api/job/filter/";
     
     //图片上传路径
     public static String IMG_UPLOAD_PATH=SERVER+"/api/uploads/images";
     
 	//修改权限
     public static String PRICAY_EDIT_PATH=SERVER+"/api/user/privacy/";
   //添加技能
     public static String SKILL_ADD_PATH=SERVER+"/api/user/skill/add";
   //删除技能
     public static String SKILL_DEL_PATH=SERVER+"/api/user/skill/delete";
     //忘记密码
     public static String FORGET_PWD_PATH=SERVER+"/api/user/reset-password";
     
     
     //主要技能设置
     public static String USER_MAINSKILL_SETTING_PATH=SERVER+"/api/user/setMasterSkill/";
     
     //添加相册照片
     public static String ALBUM_ADD_PATH=SERVER+"/api/user/albums/add";
     //删除相册照片
     public static String ALBUM_DEL_PATH=SERVER+"/api/user/albums/delete";
     //添加视频照片
     public static String VIDEO_ADD_PATH=SERVER+"/api/user/video/add";
     //删除视频照片
     public static String VIDEO_DEL_PATH=SERVER+"/api/user/video/delete";
     //招聘分类统计
     public static String JOB_CATCOUNT_PATH=SERVER+"/api/job/cat/count";
     //招聘详情
     public static String JOB_DET_PATH=SERVER+"/api/jobs/";
     //修改招聘信息
     public static String JOB_EDIT_PATH=SERVER+"/api/jobs/edit/";
     //发布招聘
     public static String JOB_RELEASE_PATH=SERVER+"/api/jobs/add";
     //查看所有招聘
     public static String JOB_ALL_PATH=SERVER+"/api/jobs/list";
     //查看某个机构所有招聘信息
     public static String ORG_JOB_ALL_PATH=SERVER+"/api/originization/job/";
   //查看某个机构现在招聘信息
     public static String ORG_JOB_CURRENT_PATH=SERVER+"/api/originization/job/current/";
   //查看某个机构历史招聘信息
     public static String ORG_JOB_HIS_PATH=SERVER+"/api/originization/job/history/";
     //招聘搜索
     public static String JOB_SEARCH_PATH=SERVER+"/api/jobs/search";
     //获取某2个用户的权限设置
     public static String AUTHORIZE_GET_PATH=SERVER+"/api/user/authorize";
     
     
     
     
     
     //收藏职位列表
     public static String JOB_RESERVE_LIST_PATH=SERVER+"/api/job/collection/";
     //收藏职位添加
     public static String JOB_RESERVE_ADD_PATH=SERVER+"/api/job/collection/add";
     //收藏职位删除
     public static String JOB_RESERVE_DEL_PATH=SERVER+"/api/job/collection/delete";
     //用户申请记录
     public static String JOB_APPLY_PATH=SERVER+"/api/user/";
     //软件功能简介
     public static String APP_FUN_DESC_PATH=SERVER+"/api/agreement/intro";
     //会员专享
     public static String APP_HYZX_PATH=SERVER+"/api/agreement/member";
     
     
     //获取机构简介
     public static String ORG_INFO_PATH=SERVER+"/api/originization/";
     //修改机构简介
     public static String ORG_INFO_MODIFY_PATH=SERVER+"/api/originization/set";
     //发送礼物
     public static String SEND_GIFT_PATH=SERVER+"/api/gift/send";
     //删除礼物
     public static String DEL_GIFT_PATH=SERVER+"/api/gift/delete";
     //已发送礼物
     public static String getSendGiftPath(String id){
    	 return SERVER+"/api/gift/"+id+"/sended";
     }
     //已收到礼物
     public static String getReceivedGiftPath(String id){
    	 return SERVER+"/api/gift/"+id+"/received";
     }
     
     
     
     
     
     
     //发送消息
     public static String CHATMSG_ADD_PATH=SERVER+"/api/chat/send";
     //获取某和某个朋友聊天记录列表
     public static String CHATMSG_LIST_PATH=SERVER+"/api/chat/";
     /**
      * 
      * @Description:TODO获取聊天的PATH
      * @param@param uid
      * @param@param fid
      * @param@param limit
      * @param@param date
      * @param@return
      * @return String
      * @author zhuw
      * @date 2013-8-19 下午2:19:43
      */
     public static String getChatPath(String uid,String fid,String limit,String firstDateTime,String lastDateTime){
    	    
       	 StringBuffer sb=new StringBuffer(CHATMSG_LIST_PATH);
       	 sb.append(uid);
       	 sb.append("/");
       	 sb.append(fid);
       	 sb.append("/get?_format=json");
       	 if(!StringUtil.isNull(limit)){
       		 sb.append("&limit=");
       		 sb.append(limit);
       	 }
     	if(!StringUtil.isNull(firstDateTime)){
      		 sb.append("&firstDateTime=");
      		 sb.append(URLEncoder.encode(firstDateTime));
      	 }
       	if(!StringUtil.isNull(lastDateTime)){
       		 sb.append("&lastDateTime=");
       		 sb.append(URLEncoder.encode(lastDateTime));
       	 }
       	return sb.toString();
       	 
        }
     
}
